﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ThanhTu.GNCMedia.KQXS.Common;

namespace WebUI.Admin.UserControls
{
    public partial class PaggingController : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {


        }
        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);
        }

        /// <summary>
        ///		Required method for Designer support - do not modify
        ///		the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
        }

     
        #endregion

        #region Method Customize
        public void RefreshControl(int currentPage, int totalPage)
        {

            this.TotalPages = totalPage;
            this.CurrentPage = currentPage;

            ddPage.Items.Clear();

            if (totalPage > 0)
            {
                for (int i = 1; i <= totalPage; i++)
                    ddPage.Items.Add(i.ToString());
                ddPage.SelectedValue = currentPage.ToString();
            }
            else
                ddPage.Items.Add("0");

        }
        #endregion
        #region Get/Set Properties
        public int CurrentPage
        {
            get { return int.Parse(lblCurrentPage.Text); }
            set { lblCurrentPage.Text = Convert.ToString(value); }
        }

        public int TotalPages
        {
            get { return int.Parse(lblTotalPages.Text); }
            set { lblTotalPages.Text = Convert.ToString(value); }
        }

        public bool NextButtonEnabled
        {
            get { return btnNext.Enabled; }
            set { btnNext.Enabled = value; }
        }

        public string NextButtonImageUrl
        {
            get { return btnNext.ImageUrl; }
            set { btnNext.ImageUrl = value; }
        }

        public bool PreviousButtonEnabled
        {
            get { return btnPrevious.Enabled; }
            set { btnPrevious.Enabled = value; }
        }

        public string PreviousButtonImageUrl
        {
            get { return btnPrevious.ImageUrl; }
            set { btnPrevious.ImageUrl = value; }
        }

        public bool FirstButtonEnabled
        {
            get { return btnFirst.Enabled; }
            set { btnFirst.Enabled = value; }
        }

        public string FirstButtonImageUrl
        {
            get { return btnFirst.ImageUrl; }
            set { btnFirst.ImageUrl = value; }
        }

        public bool LastButtonEnabled
        {
            get { return btnLast.Enabled; }
            set { btnLast.Enabled = value; }
        }

        public string LastButtonImageUrl
        {
            get { return btnLast.ImageUrl; }
            set { btnLast.ImageUrl = value; }
        }
        #endregion
       
        protected virtual void OnNextPage(DataNavigatorEventArgs args)
        {
           
        }

      
        protected virtual void OnFirstPage(DataNavigatorEventArgs args)
        {
           
        }

      

        protected void btnFirst_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnPrevious_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnNext_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnLast_Click(object sender, ImageClickEventArgs e)
        {

        }
    }
}